﻿
using LCrs.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LCrs.Web
{
    public class MyTools
    {
        public static LCrs.BLL.SysLog bllLog = new LCrs.BLL.SysLog();
        public static void WriteLog(string Message,int uid, HttpContext context)
        {
            SysLog modelLog = new SysLog();
            modelLog.AddTime = DateTime.Now;
            modelLog.AddUserID = uid;
            modelLog.IP = context.Request.UserHostAddress;
            modelLog.Message = Message;
            modelLog.Page = context.Request.UrlReferrer == null ? "" : context.Request.UrlReferrer.PathAndQuery;
            bllLog.Add(modelLog);
        }
    }
}